package com.company.class7;

/**
 * @Classname StringBuilderTest
 * @Description 类型说明
 * @Date 2022/5/2 14:41
 * @Created by zbw
 */

public class StringBuilderTest {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder();
        sb.append("3").append("zbw");
        System.out.println(sb);
        sb.insert(2,"will");
        //注意stringbuilder不是string
        sb.delete(2,6);
        String s = sb.toString();
        System.out.println(s);

        //字符串反转
        System.out.println(sb.reverse());
    }
}
